home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / bc_pas_1.zip / CDRESUME.C < prev    next >
C/C++ Source or Header  |  1992-07-01  |  1KB  |  68 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <dos.h>
  4.  
  5. #define OKAY 0
  6.  
  7. #include "cdmaster.h"
  8.  
  9. char *syntax= "Syntax: cdresume [drive #].\n";
  10. char *nodrives= "No CDROM drives attached.\n";
  11. char *nomscdex= "MSCDEX is not installed.\n";
  12.  
  13. main(int argc, char **argv)
  14. {
  15.     int numcdroms= 0;
  16.     int ourdrive= 0;
  17.     struct cdtable *cdt;
  18.  
  19.     if (!ismscdex())
  20.         {
  21.         fprintf(stderr, nomscdex);
  22.         return(1);
  23.         }
  24.  
  25.     if (!(numcdroms= getnumcdroms()))
  26.         {
  27.         fprintf(stderr, nodrives);
  28.         return(2);
  29.         }
  30.  
  31.     switch (argc)
  32.         {
  33.         case 2:
  34.             if (!(ourdrive= atoi(argv[1])))
  35.                 {
  36.                 fprintf(stderr, syntax);
  37.                 return(3);
  38.                 }
  39.             break;
  40.  
  41.         case 1:
  42.             if (!(ourdrive= getfirstcdrom()))
  43.                 {
  44.                 fprintf(stderr, nodrives);
  45.                 return(4);
  46.                 }
  47.             break;
  48.  
  49.         default:
  50.             fprintf(stderr, syntax);
  51.             return(5);
  52.         }
  53.  
  54.     printf("resume drive: %2d ", ourdrive);
  55.  
  56.     if (cdt= createaudiotoc(ourdrive))
  57.         {
  58.         int status= cdresume(ourdrive);
  59.         printf("= %X.\n", status);
  60.         destroyaudiotoc(ourdrive);
  61.         }
  62.     else
  63.         printf("failed, no initialization.\n");
  64.  
  65.     return(OKAY);
  66. }
  67.  
  68.